clear

use "/FigureD1_data.dta"


set more off


* by decade


*1830 malapportioned states
reg log_mean_rri_1830 slave_sha_1830  i.statefips if malapportion_st==1, r

avplot slave_sha_1830, name(A, replace) msymbol(circle) mfcolor(white) mlcolor(black) mlabel(stateabbrev) mlabsize(vsmall) /// 
rlopts(lcolor(red) lwidth(medium)) title("Malapportioned States, 1830") xscale(range(-0.5 0.5)) xlabel(-0.5 [.5] 0.5) yscale(range(-1.5 1.5)) ylabel(-1.5 [0.5] 1.5) ///
ytitle("e(log Average RRI | X)", size(medium))   ///
xtitle("e(County Slave Share | X)", size(medium))  ///
note("6 states, N=327, coeff = 0.75, S.E. = 0.14", size(medium)) ///
scheme(s1mono)

*1830 non-malapportioned states
reg log_mean_rri_1830 slave_sha_1830  i.statefips if malapportion_st==0, r

avplot slave_sha_1830, name(B, replace) msymbol(circle) mfcolor(white) mlcolor(black) mlabel(stateabbrev) mlabsize(vsmall) /// 
rlopts(lcolor(red) lwidth(medium)) title("Non-Malapportioned States, 1830") xscale(range(-0.5 0.5)) xlabel(-0.5 [.5] 0.5) yscale(range(-1.5 1.5)) ylabel(-1.5 [0.5] 1.5) ///
ytitle("e(log Average RRI | X)", size(medium))   ///
xtitle("e(County Slave Share | X)", size(medium))  ///
note("6 states, N=238, coeff = -0.23, S.E. = 0.11", size(medium)) ///
scheme(s1mono)

graph combine A B, name(aa, replace) scheme(s1mono)

*1840 malapportioned states
reg log_mean_rri_1840 slave_sha_1840  i.statefips if malapportion_st==1, r

avplot slave_sha_1840, name(C, replace) msymbol(circle) mfcolor(white) mlcolor(black) mlabel(stateabbrev) mlabsize(vsmall) /// 
rlopts(lcolor(red) lwidth(medium)) title("Malapportioned States, 1840") xscale(range(-0.5 0.5)) xlabel(-0.5 [.5] 0.5) yscale(range(-1.5 1.5)) ylabel(-1.5 [0.5] 1.5) ///
ytitle("e(log Average RRI | X)", size(medium))   ///
xtitle("e(County Slave Share | X)", size(medium))  ///
note("6 states, N=367, coeff = 1.01, S.E. = 0.12", size(medium)) ///
scheme(s1mono)

*1840 non-malapportioned states
reg log_mean_rri_1840 slave_sha_1840  i.statefips if malapportion_st==0, r

avplot slave_sha_1840, name(D, replace) msymbol(circle) mfcolor(white) mlcolor(black) mlabel(stateabbrev) mlabsize(vsmall) /// 
rlopts(lcolor(red) lwidth(medium)) title("Non-Malapportioned States, 1840") xscale(range(-0.5 0.5)) xlabel(-0.5 [.5] 0.5) yscale(range(-1.5 1.5)) ylabel(-1.5 [0.5] 1.5) ///
ytitle("e(log Average RRI | X)", size(medium))   ///
xtitle("e(County Slave Share | X)", size(medium))  ///
note("6 states, N=368, coeff = -0.08, S.E. = 0.09", size(medium)) ///
scheme(s1mono)
graph combine C D, name(bb, replace) scheme(s1mono)

*1850 malapportioned states
reg log_mean_rri_1850 slave_sha_1850  i.statefips if malapportion_st==1, r

avplot slave_sha_1850, name(E, replace) msymbol(circle) mfcolor(white) mlcolor(black) mlabel(stateabbrev) mlabsize(vsmall) /// 
rlopts(lcolor(red) lwidth(medium)) title("Malapportioned States, 1850") xscale(range(-0.5 0.5)) xlabel(-0.5 [.5] 0.5) yscale(range(-1.5 1.5)) ylabel(-1.5 [0.5] 1.5) ///
ytitle("e(log Average RRI | X)", size(medium))   ///
xtitle("e(County Slave Share | X)", size(medium))  ///
note("7 states, N=433, coeff = 1.09, S.E. = 0.1", size(medium)) ///
scheme(s1mono)

*1850 non-malapportioned states
reg log_mean_rri_1850 slave_sha_1850  i.statefips if malapportion_st==0, r

avplot slave_sha_1850, name(F, replace) msymbol(circle) mfcolor(white) mlcolor(black) mlabel(stateabbrev) mlabsize(vsmall) /// 
rlopts(lcolor(red) lwidth(medium)) title("Non-Malapportioned States, 1850") xscale(range(-0.5 0.5)) xlabel(-0.5 [.5] 0.5) yscale(range(-1.5 1.5)) ylabel(-1.5 [0.5] 1.5) ///
ytitle("e(log Average RRI | X)", size(medium))   ///
xtitle("e(County Slave Share | X)", size(medium))  ///
note("7 states, N=440, coeff = -0.03, S.E. = 0.1", size(medium)) ///
scheme(s1mono)

graph combine E F, name(cc, replace) scheme(s1mono)

*1860 malapportioned states
reg log_mean_rri_1860 slave_sha_1860  i.statefips if malapportion_st==1, r

avplot slave_sha_1860, name(G, replace) msymbol(circle) mfcolor(white) mlcolor(black) mlabel(stateabbrev) mlabsize(vsmall) /// 
rlopts(lcolor(red) lwidth(medium)) title("Malapportioned States, 1860") xscale(range(-0.5 0.5)) xlabel(-0.5 [.5] 0.5) yscale(range(-1.5 1.5)) ylabel(-1.5 [0.5] 1.5) ///
ytitle("e(log Average RRI | X)", size(medium))   ///
xtitle("e(County Slave Share | X)", size(medium))  ///
note("7 states, N=501, coeff = 1.04, S.E. = 0.08", size(medium)) ///
scheme(s1mono)

*1860 non-malapportioned states
reg log_mean_rri_1860 slave_sha_1860  i.statefips if malapportion_st==0, r

avplot slave_sha_1860, name(H, replace) msymbol(circle) mfcolor(white) mlcolor(black) mlabel(stateabbrev) mlabsize(vsmall) /// 
rlopts(lcolor(red) lwidth(medium)) title("Non-Malapportioned States, 1860") xscale(range(-0.5 0.5)) xlabel(-0.5 [.5] 0.5) yscale(range(-1.5 1.5)) ylabel(-1.5 [0.5] 1.5) ///
ytitle("e(log Average RRI | X)", size(medium))   ///
xtitle("e(County Slave Share | X)", size(medium))  ///
note("7 states, N=597, coeff = 0.08, S.E. = 0.06", size(medium)) ///
scheme(s1mono)

graph combine G H, name(dd, replace) scheme(s1mono)

graph combine aa bb cc dd, name(j, replace)  cols(1) iscale(.7273) ysize(12) xsize(7)  graphregion(margin(zero)) scheme(s1mono)


